<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use think\Route;

Route::rule('index','index/Index/index');
Route::rule('api','index/Index/api');

// Route::rule('backend/article/:id',function(){
//   return 'Hello,world!';
// });
Route::get('backend/excel/articleout', 'backend/Excel/ArticleOut');
Route::get('backend/excel/userout', 'backend/Excel/UserOut');
Route::post('backend/excel/articleup', 'backend/Excel/ArticleUpLoad');
Route::post('backend/excel/userup', 'backend/Excel/UserUpLoad');
//文章管理
//文章
Route::resource('backend/article','backend/Article');

//评论
Route::resource('backend/comment','backend/Comment');

//用户管理
//用户
Route::resource('backend/user','backend/User');

//权限
Route::resource('backend/permission','backend/Permission');

//多图上传
Route::post('backend/imgupload','backend/Image/Upload');
Route::post('backend/imgsubmit', 'backend/Image/Move');


//    后台
Route::rule('backend','backend/Index/index');

Route::post('backend/keepalive', 'backend/Index/KeepAlive');

// 登录
Route::post('backend/login','backend/Index/Login');
Route::rule('backend/loginimage','backend/Index/LoginImage');

// 注册
Route::post('backend/register','backend/Index/Register');
Route::rule('backend/regimg','backend/Index/RegisterImage');

//退出
Route::get('backend/loginout', 'backend/Index/LoginOut');



//后台统计
Route::rule('backend/articlecount', 'backend/Count/ArticleCount');
Route::rule('backend/websitecount', 'backend/Count/WebsiteCount');
// Route::rule('backend/imgupload', 'backend/Count/ImageUpload');

//环境云
Route::rule('v2/weatherforecast/:citycode','index/Api/weatherforecast');
Route::rule('v2/citycode/:cityname','index/Api/citycode');
Route::rule('v2/cityairhistory/:citycode','index/Api/cityairhistory');
Route::rule('v2/cityairlive/:citycode/:type','index/Api/cityairlive');

//中央天气预报
Route::rule('central/all/:cityname','index/CentralWeather/AllWeather');
Route::rule('central/future24h','index/CentralWeather/Future24h');



// return [
//     '__pattern__' => [
//         'name' => '\w+',
//     ],
//     '[hello]'     => [
//         ':id'   => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
//         ':name' => ['index/hello', ['method' => 'post']],
//     ],

// ];
